Skip to content

Add MPC profiling metrics#421

Open
zhouwfang wants to merge 1 commit intomainfrom
zhoufang/iop-315-profile
Open

Add MPC profiling metrics#421
zhouwfang wants to merge 1 commit intomainfrom
zhoufang/iop-315-profile

Conversation

@zhouwfang
Copy link
Copy Markdown
Contributor

No description provided.

@zhouwfang zhouwfang requested review from benr-ml and jonas-lj April 8, 2026 22:29
@zhouwfang zhouwfang requested a review from bmwill as a code owner April 8, 2026 22:29
@zhouwfang zhouwfang force-pushed the zhoufang/iop-315-profile branch from efd6d1b to f8c6e94 Compare April 8, 2026 22:35
Comment on lines +131 to +134
let response_size = response.get_ref().encoded_len();
let resp = RetrieveMessagesResponse::try_from(response.get_ref())
.map_err(|e| tonic::Status::internal(e.to_string()))?;
Ok((resp, request_size, response_size))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we want to add metrics to the clients/servers then we should leverage middleware as it will be much cleaner and keep the business logic free from this instrumentation.

You can take a look at MystenLabs/sui-rust-sdk#237 for how middleware can be added to grpc clients and https://github.com/bmwill/sui/blob/bf4f4c2e66964ba3668baa2accbf0521c9aa0e81/crates/sui-rpc-api/src/lib.rs#L229-L243 for how middleware can be added to the server side (I think we do already do some server side metrics using this paradigm.)

Comment on lines +748 to +751
metrics
.mpc_dealer_crypto_duration_seconds
.with_label_values(&[MPC_LABEL_DKG])
.observe(crypto_start.elapsed().as_secs_f64());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants